package com.cdv.ns.weix.servers.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.ImportResource;
import org.springframework.stereotype.Component;

@ConditionalOnProperty(prefix = "tools", name = "nsite", matchIfMissing = false)
@Component("NSite")
public class NSiteAutoConfiguration {
	@ConditionalOnProperty(prefix = "tools", name = "nsite", havingValue = "in-memory", matchIfMissing = false)
	@ImportResource({ //
			//"file:./config/mongodb.xml", //
			"file:./config/elastic.xml", //
			//
			"classpath:com/cdv/nsite/uc/uc-svc-base.xml", //
			"classpath:com/cdv/nsite/authc/authc-svc-base.xml", //
			"classpath:com/cdv/nsite/fc/fc-svc-base.xml", //
			"classpath:com/cdv/nsite/fc/task/fc-tasks-base.xml", //
			"classpath:com/cdv/nsite/wf/wf-svc-base.xml", //
			"classpath:com/cdv/nsite/mo/mo-svc-base.xml", //
			"classpath:com/cdv/nsite/sss/sss-svc-base.xml", //
			"classpath:com/cdv/nsite/echo/echo-svc-base.xml", //
			"classpath:com/cdv/nsite/im/im-svc-base.xml", //
			"classpath:com/cdv/nsite/tgs/tgs-svc-base.xml", //
			"classpath:com/cdv/nsite/fc/task/proc/fc-taskproc-base.xml", //

	})
	static class NSiteAllConfig {
	}

	@ConditionalOnProperty(prefix = "tools", name = "nsite", havingValue = "in-dubbo", matchIfMissing = false)
	@ImportResource({ //
			"classpath:com/cdv/ns/weix/dubbox.xml", //
			"classpath:com/cdv/nsite/uc/uc-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/authc/authc-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/fc/fc-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/wf/wf-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/mo/mo-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/sss/sss-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/echo/echo-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/im/im-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/tgs/tgs-api-base-dubbo.xml", //
			"classpath:com/cdv/nsite/onair/paas/onair-base.xml" //

	})
	static class NSiteDubboxConfig {
	}
	
//	@ConditionalOnProperty(prefix = "tools", name = "nsite-mongoidx", havingValue = "in-memory", matchIfMissing = false)
//	@ImportResource(locations = { "classpath:com/cdv/ns/tonglian/servers/idx-beans.xml" })
//	static class MongoIdxConfig {
//	}
}
